package com.htfyun.factorytest.engineer_test;

import android.os.Bundle;
import android.view.View;
import android.widget.RadioGroup;

import androidx.fragment.app.Fragment;

import java.util.ArrayList;

import com.htfyun.factorytest.R;
import com.htfyun.factorytest.utils.DebugLog;

public class EngineerActivity extends BaseActivity {
    private FragmentTabAdapter tabAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_engineer);

        View txtReturn = findViewById(R.id.txtReturn);
        if (txtReturn != null) {
            txtReturn.setOnClickListener(v -> {
                setResult(RESULT_CANCELED);
                finish();
            });
        }
        RadioGroup radioGroup = findViewById(R.id.radioGroup);

        ArrayList<Fragment> fragments = new ArrayList<>();
        fragments.add(new FragmentAssistSettings());
        fragments.add(new FragmentES7210());
        fragments.add(new FragmentNormalRecord());
        fragments.add(new FragmentXFM10213());

        tabAdapter = new FragmentTabAdapter(this, fragments, R.id.container, radioGroup);

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        DebugLog.e("engineer destroy");
    }

}
